$(function(){

    'use strict'
  
    $('[data-toggle="tooltip"]').tooltip();
  
    // set active component from list to show in desktop view by default
    //if(window.matchMedia('(min-width: 992px)').matches) {
      //$('.component-list .media:first-of-type').addClass('active');
    //}
  
  
    const componentSidebar = new PerfectScrollbar('.component-sidebar-body', {
      suppressScrollX: true
    });
  
    new PerfectScrollbar('.component-content-body', {
      suppressScrollX: true
    });
  
    new PerfectScrollbar('.component-content-sidebar', {
      suppressScrollX: true
    });
  
    $('.component-navleft .nav-link').on('shown.bs.tab', function(e) {
      componentSidebar.update()
    })
  
    $('#componentOptions').on('click', function(e){
      e.preventDefault();
      $('body').toggleClass('component-options-show');
    })
  
    $(window).resize(function(){
      $('body').removeClass('component-options-show');
    })
  
  })
  